package com.biscuit.page.basicservice.persistence.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biscuit.page.basicservice.model.entities.mysql.SysAiChatDialogue;
import com.biscuit.page.basicservice.persistence.mapper.AiChatDialogueMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author biscuit
 * @createTime 2024/6/11 10:07
 */
@Component
public class AiChatDialogueDao extends ServiceImpl<AiChatDialogueMapper, SysAiChatDialogue> {

    public void insertAndIncrement(SysAiChatDialogue aiChatDialogue) {
        super.baseMapper.insertAndIncrement(aiChatDialogue);
    }

    public List<SysAiChatDialogue> listBySessionIdAndMinuteBefore(Long sessionId, int minute) {
        return super.baseMapper.selectListBySessionIdAndMinuteBefore(sessionId, minute);
    }

    public void saveResultById(Long id, String result) {
        super.baseMapper.updateResultById(id, result);
    }
}
